<?php
include_once('connection/connection.php');
$typeScheme=$_POST['typeScheme'];
$frm=$_POST['frmId'];
if(isset($_POST['tanker_info']))
{
$tankId=$_POST['tankId'];
$tank_no=$_POST['tank_no'];
$water_supply=$_POST['qty'];
$area_covered=$_POST['area'];

$qr="update tbl_dtls_q1_tanker set total_tanker_no='$tank_no',water_quantity='$water_supply',area_covered='$area_covered' , to_date='$_REQUEST[firstinput]', from_date='$_REQUEST[secondinput]' where id='$tankId'";
$res=mysql_query($qr);


////////////////////////code for maintaining user history///////////////////
	if($typeScheme=="P&T" || $typeScheme=="TSS(P&T)")
	{
		$qryHistory="insert into tbl_new_user_history(user_id,form_id,action_id,ip_address,modify_date,user_type,user_name) values('$_POST[loginId]','$frm','26','$_SERVER[REMOTE_ADDR]',NOW(),'$_POST[userType]','$_POST[name]')";
	}
	if($typeScheme=="Piped")
	{
		$qryHistory="insert into tbl_new_user_history(user_id,form_id,action_id,ip_address,modify_date,user_type,user_name) values('$_POST[loginId]','$frm','52','$_SERVER[REMOTE_ADDR]',NOW(),'$_POST[userType]','$_POST[name]')";
	}
	if($typeScheme=="Sanitary Diggs")
	{
		$qryHistory="insert into tbl_new_user_history(user_id,form_id,action_id,ip_address,modify_date,user_type,user_name) values('$_POST[loginId]','$frm','78','$_SERVER[REMOTE_ADDR]',NOW(),'$_POST[userType]','$_POST[name]')";
	}
	
	
	mysql_query($qryHistory);
	///////////////////////////////
if($res)
{
header("location:q1.php");
}
}
?>
